
import Head from 'next/head'

<Head>
  <script>
    {
      `(function() {
         var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e60fb290e204e04c5cb6f79b0ac1e697";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
       })();`
    }
  </script>
</Head>

![LangChain](https://pica.zhimg.com/50/v2-56e8bbb52aa271012541c1fe1ceb11a2_r.gif)



# LLM Math
这个notebook演示了如何使用LLMs和Python REPLs来解决复杂的数学问题。
```python
from langchain import OpenAI, LLMMathChain

llm = OpenAI(temperature=0)
llm_math = LLMMathChain.from_llm(llm, verbose=True)

llm_math.run("What is 13 raised to the .3432 power?")
```
输出如下：
```python
> 进入新的LLMMathChain链...
13的0.3432次方是多少？
```text
13 ** .3432
```python
...numexpr.evaluate("13 ** .3432")...

答案：2.4116004626599237
> 链结束。
```
'答案：2.4116004626599237'